// Copyright (c) 2015-present, salesforce.com, inc. All rights reserved
// Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license

@mixin list-has-bullets {
  margin-left: $spacing-large;
  list-style: disc;
}

@mixin list-has-numbers {
  margin-left: $spacing-large;
  list-style: decimal;
}

// Apply theme on hover for list items
@mixin list-has-hovers {

  &:hover {
    background-color: var(--slds-g-color-neutral-base-95, #{$color-background-row-hover});
    border-color: var(--slds-g-color-border-base-1, #{$color-border});
    cursor: pointer;
  }

  &:active {
    background-color: var(--slds-g-color-neutral-base-95, #{$color-background-row-active});
    box-shadow: var(--slds-g-color-border-base-1, #{$color-border}) 0 ($border-width-thin * -1) 0 inset;
  }
}

// Apply theme on selection for list items
@mixin list-has-selections {

  &.slds-is-selected {
    box-shadow: var(--slds-g-color-brand-base-50, #{$color-border-selection}) 0 0 0 $border-width-thin inset;
    background-color: var(--slds-g-color-neutral-base-95, #{$color-background-row-selected});

    &:hover,
    &:focus {
      box-shadow: var(--slds-g-color-border-brand-2, #{$color-border-selection-hover}) 0 ($border-width-thick * -1) 0 inset, var(--slds-g-color-border-brand-2, #{$color-border-selection-hover}) 0 0 0 $border-width-thin inset;
    }
  }
}

// Output dot separators based on direction parameter
//
// @require $size, $direction, $color, $mq
// @param $direction {String} Position of dot, accepts 'left' or 'right'
// @param $size {String} Defines the width and height of the dot
// @param $color {String} Defines the color of the dot
// @param $mq {Boolean} If you want a dots on touch device or not

@mixin dot-separator($direction: right, $size: 2px, $color: $color-background-indicator-dot, $mq: null) {
  position: relative;
  display: flex;
  align-items: center;

  @if $direction == right {

    &:after {
      @include square($size);
      content: '';
      margin: {
        left: $spacing-x-small;
        right: $spacing-x-small;
      }
      border-radius: $border-radius-circle;
      background-color: $color;
    }

    &:last-child {
      margin-right: 0;
      padding-right: 0;

      &:after {
        content: none;
      }
    }
  }

  @else if $direction == left {

    &:before {
      @include square($size);
      content: '';
      display: inline-block;
      vertical-align: middle;
      margin: {
        left: $spacing-x-small;
        right: $spacing-x-small;
      }
      border-radius: $border-radius-circle;
      background-color: $color;
    }

    &:first-child {
      margin-right: 0;
      padding-right: 0;

      &:before {
        content: none;
      }
    }
  }

  @if $mq != null {
    @include mq-medium-max {

      &:before,
      &:after {
        content: none;
      }
    }
  }
}


@mixin align-horizontal($children: null, $fallback: null, $mq: null) {
  display: flex;

  @if $mq != null {
    flex-direction: column;

    @include mq-medium-min {
      flex-direction: row;
    }
  }

  @if $children != null {

    > #{$children} {
      align-self: center;
    }
  }
}
